package com.xuecheng.manage_media.config;


import org.springframework.amqp.core.*;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * RabbitMQ的配置类
 */
@Configuration
public class RabbitMQConfig {

    // 交换机名称
    public static final String EX_ROUTING_MEDIA_POSTPAGE = "ex_routing_media_postpage";
    // 视频处理队列名称
    @Value("${xc-service-manage-media.mq.queue-media-video-processor}")
    public String queue_media_postpage_name;
    // 视频处理路由
    @Value("${xc-service-manage-media.mq.routingkey-media-video}")
    public String routingKey;

    // 配置交换机
    @Bean(EX_ROUTING_MEDIA_POSTPAGE)
    public Exchange EXCHANGE_TOPICS_INFORM(){
        return ExchangeBuilder.directExchange(EX_ROUTING_MEDIA_POSTPAGE).durable(true).build();
    }

}
